package com.lingo.a2b.common.config;

import com.lingo.a2b.common.exception.BizException;
import com.lingo.a2b.response.MyResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author lingo
 * @date 2020/5/21 16:23
 * @Company: www.xyb2b.com
 */
@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value = BizException.class)
    public MyResponse<?> handleBiz(BizException e){
        return MyResponse.fail(e.getMessage());
    }
}
